#ifndef __BYTE_BUILDER_H__
#define __BYTE_BUILDER_H__ 1

#include "bit_source.h"

/**
 * @brief Assembles bits to bytes. Splits bytes to bits.
 * @author gpitsch and rpoisel
 * @note capable to operate in full duplex
 *
 * this needs a IStegIO as "real" data source/sink where
 * the bytes are read from and written to
 */
class CByteBuilder : public IBitSource
{
public:

	/**
	 * @param pStegIO data source/sink for stego payload
	 */
	CByteBuilder(IStegIO* pStegIO);

	virtual ~CByteBuilder();
	virtual int getBit(bool& pReadBit);
	virtual bool putBit(bool pWriteBit);

private:
	CByteBuilder(const CByteBuilder& );
	CByteBuilder& operator=(const CByteBuilder& );

	IStegIO* mStegIO;
	unsigned char mBufferRead;
	unsigned char mBufferWrite;
	int mBitsUsedRead;
	int mBitsUsedWrite;
};

#endif // __BYTE_BUILDER_H__

